<?php

namespace app\controller;

use app\BaseController;
use think\facade\Request;
use app\utils\Format;

class Index extends BaseController
{

    public function __construct()
    {
 
    }
    public function format() {
        $param = Request::post();

        $format = new Format($param['types'] ?? null);

        $output = $format->run($param['code']);

        return $output;
    }

    public function getTypes() {
        $types = Format::showTypes();

        return json($types);
    }
}
